package File;

import java.io.File;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-08-12
 * Time: 16:25
 */
public class Demo3 {
    public static void main(String[] args) throws InterruptedException {
        // 文件删除
        File file = new File("helloworld.txt");
        // 程序退出时才删除, 创建一些临时文件.等到文件结束，才把helloworld给删除
        file.deleteOnExit();
        Thread.sleep(5000);
        System.out.println(file.exists());
    }
}
